package init

import (
	"api-gateway/utils"
	"log"
)

func init() {
	InitConsul()
}

func InitConsul() {
	client, err := utils.NewConsulClient("14.103.243.156", 8500)
	if err != nil {
		return
	}
	register := utils.ConsulRegister{
		ID:      "xxfz",
		Name:    "user-server",
		Tags:    []string{"user-server"},
		Port:    8888,
		Address: "localhost",
	}
	err = client.Register(register)
	if err != nil {
		panic(err)
	}
	log.Println("ok")
}
